import 'package:mmkv/mmkv.dart';

class MMKVUtil {
  var mmkv = MMKV("flutter_youren_mmkv_login",
      mode: MMKVMode.SINGLE_PROCESS_MODE, cryptKey: "cryptkey");

  MMKVUtil._privateConstructor();

  static final MMKVUtil instance = MMKVUtil._privateConstructor();

  putString(String key, String value) {
    mmkv.encodeString(key, value);
  }

  String? getString(String key) {
    return mmkv.decodeString(key);
  }

  putInt(String key, int value) {
    mmkv.encodeInt(key, value);
  }

  int? getInt(String key) {
    return mmkv.decodeInt(key);
  }

  removeValue(String key) {
    mmkv.removeValue(key);
  }

  removeValues(List<String> keys) {
    mmkv.removeValues(keys);
  }
}
